#define _CRT_SECURE_NO_WARNINGS 1
#include"HeapSort.h"


int main()
{
	int arr[10] = { 152,483,625,795,148,203,102,630,741,555 };
	//JumpUp(arr, sizeof(arr) / sizeof(int) - 1);
	int n = sizeof(arr) / sizeof(int);
	int i = 0;
	for (i = (n - 1 - 1) / 2; i >= 0; i--)
	{
		JumpDown(arr, n, i);

	}

	int end = n - 1;
	while (end > 0)
	{
		int tmp = arr[end];
		arr[end] = arr[0];
		arr[0] = tmp;

		JumpDown(arr, end, 0);
		end--;
	}

	for (int i = 0; i < 10; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}